Component({
  properties: {
    showShare: {
      type: Boolean,
      value: false
    }
  },
  observers: {
    showShare () {
      this.data.showShare ? wx.hideTabBar() : wx.showTabBar()
      this.setData({
        show: this.data.showShare
      })
    }
  },
  data: {
    show: false,
    options: [
      { name: '微信', icon: 'wechat', openType: 'share' },
      { name: '微博', icon: 'weibo' },
      { name: '复制链接', icon: 'link' },
      { name: '分享海报', icon: 'poster' },
      { name: '二维码', icon: 'qrcode' }
    ]
  },
  methods: {
    onClick (event) {
      this.setData({ showShare: true })
    },

    onClose () {
      this.setData({ showShare: false })
    },

    onSelect (event) {
      console.log(event.detail.name)
      this.onClose()
    }
  }
})
